﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IronOne.SalesOne.BusinessObjects;
using IronOne.SalesOne.DataObjects;
using System.ComponentModel;
using System.Web.UI.WebControls;


namespace Facade
{
    public class ConfiguraionFacade
    {
        #region Batch Job
        LinqJob linqJob = new LinqJob();

        [DataObjectMethod(DataObjectMethodType.Select)]
        public bool UpdateSchedule(BatchJob job, string currentUser)
        {
            return linqJob.UpdateSchedule(job, currentUser);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<ListItem> GetAvailableJobs()
        {
            return linqJob.GetAvailableJobs();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public BatchJob GetSchduleParams(string scheduleName)
        {
            return linqJob.GetAvailableJobs(scheduleName);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<JobHistory> getHistoryForJob(string jobId, int pageNo)
        {
            return linqJob.getHistoryForJob(jobId, pageNo);
        }

        #endregion

        #region Emails

        LinqEmails emails = new LinqEmails();

        
        public int InsertEmails(Emails e)
        {
           return emails.InsertEmails(e);
        }

        
        public List<string> GetAvailableMailJobs()
        {
            return emails.GetAvailableMailJobs();
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public Emails getJobInfo(string p)
        {
            return emails.getJobInfo(p);
        }
        #endregion



        
    }
}
